Repository navigation
[1410] OAuth 登录落盘后自动激活 provider 白名单 - #28
Merged
Merged
Conversation
与 pi-save-auth-key 对齐:pi-save-auth-oauth! 在写入 auth.json 之后, 调用 pi-auth-save-provider-whitelist! 把该 provider 合并进 models/providers.json 白名单,使随后的 reload_models/models_updated 让 /model 与 --list-models 立即把 OAuth provider 视为已启用。 将 auth-path 提到 let* 头部以便落盘失败提前返回;更新两个测试覆盖 新增的白名单写入与既有条目保留语义。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
pi-save-auth-key(API Key 登录)在写入auth.json之后,会调用pi-auth-save-provider-whitelist!把该 provider 合并进models/providers.json白名单,使随后的reload_models/models_updated让/model与--list-models立即把该 provider 视为已启用。但
pi-save-auth-oauth!(OAuth 登录)只落盘了auth.json,缺少这一步,导致 OAuth 登录成功后 provider 不会自动出现在/model与--list-models中,需要用户手动激活,与 API Key 登录体验不一致。改动
ai/liii/pi/ai/auth.scmpi-save-auth-oauth!与pi-save-auth-key对齐:在写入auth.json之后调用pi-auth-save-provider-whitelist!合并 provider 白名单。auth-path提到let*备份头,落盘失败可提前返回;类型校验仍保留在写文件之后。ai/tests/.../pi-save-auth-oauth-bang-test.scmmodels/providers.json含该 provider。deepseek)保留。tui/tests/.../pi-app-handle-oauth-done-bang-test.scm["google"]白名单,验证 OAuth 完成后白名单为["google", "kimi-coding"](保留原条目并激活新 provider)。关联
Issue #1410